# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=partclone
pkgver=0.3.20
pkgrel=0
pkgdesc="utilities to save and restore used blocks on a partition"
url="https://partclone.org"
arch="all"
license="GPL-2.0-only"
makedepends="
	e2fsprogs-dev
	btrfs-progs-dev
	ntfs-3g-dev
	f2fs-tools-dev
	hfsprogs
	ncurses-dev
	automake
	autoconf
	libxslt-dev
	docbook-xml
	libtool
	intltool
	gettext-dev
	openssl-dev
	diffutils
	coreutils
	bash
	"
subpackages="$pkgname-doc $pkgname-lang"
source="https://github.com/Thomas-Tsai/partclone/archive/$pkgver/partclone-$pkgver.tar.gz
	musl.patch
	"

if [ "$CARCH" = "riscv64" ]; then
	options="$options textrels"
fi

build() {
	autoreconf -vif
	# xfs seems broken right now :(
	LIBS="-lintl" ./configure --prefix=/usr \
		--disable-rpath \
		--enable-ncursesw \
		--enable-fat \
		--enable-extfs \
		--enable-exfat \
		--enable-ntfs \
		--enable-btrfs \
		--enable-minix \
		--enable-f2fs \
		--enable-hfsp
	make
}
check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

}

sha512sums="
32dced369973c39412c562ab8731ff7b490f464b5ed4033456e6b23f3f79c437f43dc9db4c79b4821f35e4997d1444c8d80c53816b2a3bb90836fb5ad33b368e  partclone-0.3.20.tar.gz
0676b34c5818f8866e733b0aee151e8220b8db839ba732acfdaad4dcea81a4b5d514a520e43c79efcf53ba0788c9a7f06c043441b4d1f56dd684882329efce9d  musl.patch
"
